﻿// Extensions Made Easy - Copyright 2012 by Jan Van der Haegen - All rights reserved, use for educational purposes only.
using System;
using Microsoft.LightSwitch.Sdk.Proxy;
using Microsoft.VisualStudio.ExtensibilityHosting;

namespace ExtensionsMadeEasy.ClientAPI.Utilities.Extensions
{
    public static class ServiceProxyExtension
    {
        private static IServiceProxy serviceProxy;
        public static IServiceProxy GetServiceProxy(this object o)
        {
            if (null == serviceProxy)
            {
                serviceProxy = VsExportProviderService.GetExportedValue<IServiceProxy>();
            }
            return serviceProxy;
        }
    }
}